//
//  MBProgressHUD+MJ.h
//
//  Created by mj on 13-4-18.
//  Copyright (c) 2013年 itcast. All rights reserved.
//

#import <MBProgressHUD/MBProgressHUD.h>
//typedef void(^MBProgressHUDTapBlock)(void);

@interface MBProgressHUD (JK)
//@property(nonatomic ,copy)MBProgressHUDTapBlock tap;
/**
 *  显示一张图片*****需要手动删除
 *
 *  @param imageName 图片的名称   必须png格式
 *  @param str       提示文字
 *  @param view      supperView
 *
 *  @return self
 */
+(MBProgressHUD*)showImage:(NSString*)imageName withStr:(NSString*)str toView:(UIView*)view;
/**
 *  显示一张图片*****需要手动删除
 *
 *  @param gifName gif名称，不可待后缀
 *  @param str     提示文字
 *  @param view    supperView
 *
 *  @return self
 */
+(MBProgressHUD*)showGIF:(NSString*)gifName withStr:(NSString*)str toView:(UIView*)view;
///
+(MBProgressHUD*)showCustomAnimationWithStr:(NSString*)str toView:(UIView*)view;
/**
 *  显示一张纯文字提示框，1.5秒后消失
 *
 *  @param str  提示文字
 *  @param view supperView
 *
 *  @return self
 */

+(MBProgressHUD*)showLabWithStr:(NSString*)str toView:(UIView*)view;
/**
 *  菊花样式*****需要手动删除
 *
 *  @param str  提示文字
 *  @param view supperView
 *
 *  @return self
 */
+(MBProgressHUD*)showActivityWithStr:(NSString*)str toView:(UIView*)view;
/**
 *  圆形线进度*****需要手动删除
 *
 *  @param str  提示文字
 *  @param view supperView
 *
 *  @return self
 */
+(MBProgressHUD*)showLineWithStr:(NSString*)str progress:(CGFloat)progress toView:(UIView*)view;
/**
 *  扇形进度*****需要手动删除
 *
 *  @param str  提示文字
 *  @param view supperView
 *
 *  @return self
 */
+(MBProgressHUD*)showProgressWithStr:(NSString*)str progress:(CGFloat)progress toView:(UIView*)view;
+(MBProgressHUD*)showLeftImage:(NSString* )image rightLab:(NSString*)labText toView:(UIView*)view;
+(MBProgressHUD*)showOtherViewWithXibName:(NSString*)xibName  obj:(NSInteger)obj toView:(UIView*)view;
+(void)dissmissAfterTime:(CGFloat)time;
+(void)dissmiss;

@end

static inline MBProgressHUD* showRequestHUD(NSString* str,UIView* toView){
    return [MBProgressHUD showCustomAnimationWithStr:str?str:@"加载中..." toView:toView];
}
static inline void hidenRequestHUD(){
    [MBProgressHUD dissmiss];
}
static inline MBProgressHUD* showMsg(NSString* str,UIView* toView){
    [MBProgressHUD dissmiss];
    if (!str.length) {
        return nil;
    }
    return [MBProgressHUD showLabWithStr:str toView:toView];
}
